<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <link rel="stylesheet" href="css/index.css" />
    <script src="js/vue.js"></script>
    <script src="js/elementui.js"></script>
    <script src="js/common.js"></script>
    <script src="js/vue-grid-layout.umd.min.js"></script>
</head>
<body>
    <div id="app">
        官方注册微博名:
        <input type="text" v-model="weiboName"/>
        <br/>
        所在地:
        <select v-model="province" @change="updateCities">
            <option value="">请选择</option>
            <option value="湖南">湖南</option>
            <option value="湖北">湖北</option>
        </select>
        <select v-model="city">
            <option value="">请选择</option>
            <option v-for="city in cities" :key="city" :value="city">{{ city }}</option>
        </select>
		<br/>
        <input type="checkbox" v-model="agreed"/> 我已阅读协议
        <br/>
        <input type="submit" title="提交" :disabled="!agreed"/>
    </div>
</body>
<script>
    new Vue({
        el: "#app",
        data: {
            weiboName: '',
            province: '',
            city: '',
            cities: [],
            agreed: false,
            cityOptions: {
                湖南: ['长沙', '株洲'],
                湖北: ['武汉', '宜昌']
            }
        },
        methods: {
            updateCities() {
                this.city = '';
                this.cities = this.cityOptions[this.province] || [];
            }
        }
    })
</script>
</html>